Floating Panels > The floating panel API > initialPosition()

 

initialPosition()

Description

Determines the initial position of the floating panel the first time it is called. If this function is not defined, the default position is the center of the screen.

Arguments

platform

Possible values for platform are "Mac" and "Win".

Returns

A string of the form "leftPosInPixels,topPosInPixels".

Example

The following instance of initialPosition() specifies that the first time the floating panel appears, it should be 420 pixels from the left and 20 pixels from the top in Windows, and 390 pixels from the left side of the screen and 20 pixels from the top of the screen on the Macintosh:

function initialPosition(platform){
	var initPos = "420,20";
	if (platform == "macintosh"){
		initPos = "390,20";
	}
	return initPos;
}